<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function A() {
            this.say=function(){
                console.log("HelloA");
            }
        }
        function B(){
            this.work = function () {
                console.log("WorkB");
            }
        }
        B.prototype={
            name(){
                console.log("proto getName");
            },
            work(){
                console.log("work from B proto");
            }
        };
        // A.prototype = B.prototype;
        let a = new A();
        a.__proto__ = B.prototype;
        a.work();
    </script>
</body>
</html>